package com.mujin.keji.collectionsystem.module.main.viewmodel;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.ViewModel;

import com.mujin.keji.collectionsystem.base.BaseDto;
import com.mujin.keji.collectionsystem.module.main.dto.BannerListDto;
import com.mujin.keji.collectionsystem.module.main.repository.AdvertiseRepository;
import com.mujin.keji.collectionsystem.module.main.repository.IAdvertiseRepository;
import com.mujin.keji.collectionsystem.module.main.vo.BannerVo;

/**
 * 广告viewmodel
 *
 * @author weishixiong
 * @Time 2018-04-2
 */

public class AdvertiseViewModel extends ViewModel {
    private LiveData<BaseDto<BannerListDto>> dtoLiveData;
    private IAdvertiseRepository advertiseRepository;

    /**
     * 获取广告
     */
    public LiveData<BaseDto<BannerListDto>> getDtoLiveData() {
        advertiseRepository = new AdvertiseRepository();
        this.dtoLiveData = advertiseRepository.getAdvertises(new BannerVo());
        return dtoLiveData;
    }


}
